﻿<UserControl x:Class="personalplaner.gui.common.views.InitWizardPersonView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:p="clr-namespace:personalplaner.gui.Properties"
             xmlns:bs="clr-namespace:personalplaner.business.stamm;assembly=personalplaner.business"
             xmlns:conv="clr-namespace:personalplaner.common.converters;assembly=personalplaner.common">

    <Control.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary>
                    <BooleanToVisibilityConverter x:Key="boolVisConv"/>
                    <conv:BoolToInvertVisibilityConverter x:Key="boolInvVisConv"/>

                    <DataTemplate DataType="{x:Type bs:Person}">
                        <Grid Margin="0,0,20,0">
                            <Grid.ColumnDefinitions>
                                <!--<ColumnDefinition Width="30"/>-->
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <!--<TextBlock Text="{Binding PrsID}"/>-->
                            <TextBlock Name="txtName" Text="{Binding Name}" Grid.Column="0" Margin="5,0,5,0"/>
                            <TextBlock Name="txtNachName" Text="{Binding Nachname}" Grid.Column="1"/>
                        </Grid>
                    </DataTemplate>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Control.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <TextBlock Text="{x:Static p:Resources.Personen}" FontSize="22" FontWeight="Thin" Foreground="#E1000000" Margin="50,-5,0,15"/>
        
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="180"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <ListBox ItemsSource="{Binding Personen}" SelectedItem="{Binding ActiveGridItem}" Margin="10,10,0,0"/>

            <GroupBox Margin="5,0,5,0" Grid.Column="1">
                <ContentControl Content="{Binding SelectedView}" />
            </GroupBox>

            <!--<ContentControl Content="{Binding SelectedView}" Margin="5,5,5,0" Grid.Column="1" />-->

            <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,40,20">
                <Button MinWidth="60" Margin="5" 
                    Command="{Binding PreviousCommand}">
                    <TextBlock Text="&lt;" FontWeight="ExtraBold" VerticalAlignment="Center"/>
                </Button>
                <Button MinWidth="60" Margin="5"
                    Visibility="{Binding IsEndOfWizard, Converter={StaticResource boolInvVisConv}}"
                    Command="{Binding NextCommand}">
                    <TextBlock Text="&gt;" FontWeight="ExtraBold" VerticalAlignment="Center"/>
                </Button>
                <Button MinWidth="60" Margin="5" IsDefault="True"
                    Visibility="{Binding IsEndOfWizard, Converter={StaticResource boolVisConv}}"
                    Command="{Binding OkCommand}">
                    <TextBlock Text="{x:Static p:Resources.Add}" />
                </Button>
                <!--<Button MinWidth="60" Margin="5" IsCancel="True" 
                    Command="{Binding CancelCommand}">
                    <TextBlock Text="Abbrechen" />
                </Button>-->
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
